{layout name="layout2" /}
<style>
    /* 个人中心样式 */
    .user-dashboard {
        padding: 20px;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .user-welcome {
        background-color: #f8f9fa;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 30px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .user-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .stat-card {
        flex: 1;
        min-width: 200px;
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        text-align: center;
    }
    
    .stat-card h3 {
        color: #666;
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .stat-card .value {
        font-size: 24px;
        font-weight: bold;
        color: #3498db;
    }
    
    .recent-orders {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .recent-orders h2 {
        margin-top: 0;
        padding-bottom: 10px;
        border-bottom: 1px solid #eee;
    }
    
    .quick-actions {
        display: flex;
        justify-content: center; /* 新增：水平居中 */
        gap: 15px;
        margin: 20px 0;
        flex-wrap: wrap;
    }
    
    .action-btn {
        padding: 10px 15px;
        background: #3498db;
        color: white;
        text-decoration: none;
        border-radius: 4px;
        transition: background 0.3s;
    }
    
    .action-btn:hover {
        background: #2980b9;
    }
    
    .user-info-section {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        margin-top: 30px;
    }
    
    .info-row {
        display: flex;
        margin-bottom: 15px;
    }
    
    .info-label {
        width: 120px;
        color: #666;
    }
    
    .info-value {
        flex: 1;
    }
</style>

<div class="user-dashboard">
    <!-- 欢迎区域 -->
    <div class="user-welcome">
        <h1>欢迎回来，{$Request.session.username}！</h1>
        <p>上次登录时间：{php}echo date('Y-m-d H:i:s');{/php}</p>
    </div>
    
    <!-- 快捷操作 -->
    <div class="quick-actions">
        <a href="{:Url('user/orders/shoppingcar')}" class="action-btn">查看购物车</a>
        <a href="{:Url('user/orders/myorders')}" class="action-btn">我的订单</a>
        <a href="#" class="action-btn">个人信息</a>
    </div>
    
    <!-- 数据统计 -->
    <div class="user-stats">
        <div class="stat-card">
            <h3>待付款订单</h3>
            <div class="value">{$pendingOrders|default=0}</div>
        </div>
        <div class="stat-card">
            <h3>待收货订单</h3>
            <div class="value">{$shippingOrders|default=0}</div>
        </div>
        <div class="stat-card">
            <h3>购物车商品</h3>
            <div class="value">{$cartItems|default=0}</div>
        </div>
    </div>
    
    <!-- 个人信息 -->
    <div class="user-info-section">
        <h2>个人信息</h2>
        <div class="info-row">
            <div class="info-label">用户名：</div>
            <div class="info-value">{$Request.session.username}</div>
        </div>
        <div class="info-row">
            <div class="info-label">会员等级：</div>
            <div class="info-value">普通会员</div>
        </div>
        <div class="info-row">
            <div class="info-label">账户安全：</div>
            <div class="info-value">
                <span style="color:#27ae60;">已验证</span> | 
                <a href="#">修改密码</a>
            </div>
        </div>
    </div>
</div>